package com.wgy.designmode.action.mediator.colleague;

import com.wgy.designmode.action.mediator.mediator.Mediator;

public class User extends Colleague{

    private String name;

    public User(Mediator mediator, String name) {
        super(mediator);
        this.name = name;
    }

    @Override
    public void send(String message) {
        System.out.println(name + " 发送消息: " + message);
        mediator.sendMessage(message, this);
    }

    @Override
    public void receive(String message) {
        System.out.println(name + " 收到消息: " + message);
    }
}
